const Router = require('koa-router');

//控制器
const { add, get } = require('../controller/myDesign.controller');

//中间件
const { auth } = require('../middleware/auth.middleware');
const { validator } = require('../middleware/validator.middleware');

const router = new Router({ prefix: '/myDesign' });

//添加设计
router.post('/add', auth, validator({ design_src: 'string', design_date: 'dateTime', design_name: { type: 'string', required: false } }), add);

//获取用户设计数据
router.get('/get', auth, get);

module.exports = router;